package net.obxlabs.tweetpad.test;

import java.awt.*;
import net.nexttext.*;
import net.nexttext.behaviour.control.*;
import net.obxlabs.tweetpad.*;
import net.obxlabs.tweetpad.behaviour.*;
import processing.core.*;

public class T9NextTextThesaurus extends PApplet {
	Book book;
    Font font;
    Maker builder;
    
	public void setup() {
        size(720, 576);
        frameRate(60);
        smooth();
        
        book = new Book(this);
        builder = new Maker(book);
        book.toBuilder = builder;
        // load and set the font
        font = book.loadFont("Cyberbit.ttf");
        //builder
        book.textFont(font, 36);
        
        Swap swap = new Swap(book, builder);
        OnClickOver onPress = new OnClickOver(swap);
        //Level levelSwap = new Level(2, onPress);
        Repeat repeat = new Repeat(onPress, 0);
        book.addGlyphBehaviour(repeat.makeBehaviour());
        
        //book.addGroupBehaviour(new Repeat(new EaseTo(), 0).makeBehaviour());
		
        stroke(255, 0, 0);
        fill(0);
       
		book.addText("visualizing twitter feeds with dynamic typography", 10, 50, 100);		
		/*
		book.addText("quick", 50, 100, 100);
		book.addText("brown", 50, 150, 100);
		/*book.addText("fox", 50, 140, 100);
		book.addText("jumped", 50, 170, 100);
		book.addText("over", 50, 200, 100);
		book.addText("the", 50, 230, 100);
		book.addText("lazy", 50, 260, 100);
		book.addText("dog", 50, 290, 100);
		*/
    }

    public void draw() {
    	background(255);
        book.stepAndDraw();
    }
    
    static public void main(String args[]) {     
    	PApplet.main(new String[] { "net.obxlabs.sketchpad.test.T9NextTextThesaurus" });  
    }
}
